#!/usr/bin/env bash
# Brief : 

# 使用绝对路径避免意外
base_folder=/home/hanxiao/Desktop/TEST_t
# exe_folder=/home/hanxiao/wspace/aiforcetech_arm_n/src/Decision/decision_controller/
# exe_folder=/home/hanxiao/wspace/code_from_git/Decision/build/
exe_folder=/home/hanxiao/wspace/docker_src/sfc-src/build_ninja/deploy/  # for zhiyun 
exe_name=control_semi_auto

##########
full_exe=$exe_folder$exe_name
target_exe=./$exe_name
##########
read -p "请输入此次测试为当天第几版: " num

if ! [[ "$num" =~ ^[0-9]+$ ]]; then
  echo "输入的不是数字，请重新运行脚本并输入数字！"
  exit 1
fi

folder_name=$base_folder/$(date +%Y-%m-%d)/V$num

mkdir -p "$folder_name" 
echo "创建目录 $folder_name 成功！"

cd $folder_name
#cp /home/hanxiao/wspace/aiforcetech_arm_n/src/Decision/decision_controller/DecisionControlNode ./DecisionControlNode
cp -p $full_exe $target_exe
echo "Source exe : ${full_exe}"
# echo ""
